using UnityEngine;

namespace DL
{
    //武器跟随
    public class WeaponFollow : MonoBehaviour
    {
        public Transform followPoint;

        private Vector3 m_Velocity = Vector3.zero;

        public float smoothTime = 0.05f;
        
        private void OnEnable()
        {
            transform.position = this.followPoint.position;
        }
        private void Update()
        {
            Vector3 position = this.followPoint.position;
            transform.position =
                Vector3.SmoothDamp(transform.position, position, ref this.m_Velocity, this.smoothTime);
            transform.rotation = this.followPoint.rotation;
        }


    }
}
